home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / hypercar / xfcn / spttool.cpt / Support Tools eXternals 1.2.5 / stack_-1.xml < prev    next >
Encoding:
Extensible Markup Language  |  1990-11-14  |  4.0 KB  |  16 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
  3. <stack>
  4.     <name>in.5</name>
  5.     <id>-1</id>
  6.     <cardCount>53</cardCount>
  7.     <cardID>18126</cardID>
  8.     <listID>2932</listID>
  9.     <cantModify><true /></cantModify>
  10.     <cantDelete><false /></cantDelete>
  11.     <cantAbort><false /></cantAbort>
  12.     <cardSize>
  13.         <width>512</width>
  14.         <height>342</height>
  15.     </cardSize>
  16.     <script>-- Support Tools eXternals 1.2.5
  17. -- copyright ┬⌐ 1989, 1990, Apple Computer, Inc. All rights reserved
  18. -- last modified 7:59 PM 11/13/90 ec
  19. --
  20.  
  21. on openStack
  22. set userModify to true
  23. end openStack
  24.  
  25. on openCard
  26. if the short name of this cd = ┬¼
  27. the short name of cd (number of last cd of this bg) then
  28. hide bg btn "next"
  29. else
  30. show bg btn "next"
  31. end if
  32.  
  33. if the short name of this cd = ┬¼
  34. the short name of cd (number of first cd of this bg) then
  35. hide bg btn "previous"
  36. else
  37. show bg btn "previous"
  38. end if
  39. pass openCard
  40. end openCard
  41.  
  42. function clickLine
  43. -- returns line number clicked on of any field
  44. if the style of the target = "scrolling" then
  45. return ((item 2 of the clickLoc - top of target-4+scroll of target) ┬¼
  46. div textheight of target) + 1
  47. else
  48. -- clickLine for non scrolling fields
  49. return ((item 2 of the clickLoc - top of target - 4) ┬¼
  50. div textheight of target) + 1
  51. end if
  52. end clickLine
  53.  
  54. function selectTheLine whichLine
  55. put line whichLine of target into choice
  56. if choice <> empty then
  57. get offset(return & choice,target) + 1 --include the carriage return
  58. select char it to length(choice) + it of target
  59. end if
  60. return choice
  61. end SelecttheLine
  62.  
  63. function thisFolderPath -- returns the path to the current folder
  64. put stackPath() into stackFolder
  65. put "" into lastChar
  66. repeat until lastChar = ":"
  67. delete last character of stackFolder
  68. put last character of stackFolder into lastChar
  69. end repeat
  70. return stackFolder
  71. end thisFolderPath
  72.  
  73. function thisVolumePath
  74. put thisStackPath() into wholePath
  75. return char 1 to offset(":",wholePath) of wholePath
  76. end thisVolumePath
  77.  
  78. function thisStackPath
  79. return the value of word 2 of long name of this stack
  80. end thisStackPath
  81.  
  82. on Import
  83. if rect of fld "description" Γëá "258,116,509,336" then ZoomField
  84. send "HideObjects" to this cd
  85. show bg fld "source"
  86. put FilePath("TEXT","Choose a file to import") into fName
  87. if fName = empty then exit Import
  88. go this cd
  89. put empty into bg fld "source"
  90. open file fName
  91. repeat
  92. read from file fName for 30000
  93. if it = empty then exit repeat
  94. put SubstituteChar(tab, "  ", it) after bg fld source
  95. end repeat
  96. show bg btn "source"
  97. close file fName
  98. end Import
  99.  
  100. function SubstituteChar origChar, newChar, container
  101. --returns the given container with the original string
  102. --substituted in all cases for the given new str.
  103. repeat
  104. set cursor to busy
  105. put offset(origChar,container) into charPos
  106. if charPos = 0 then return container
  107. put newChar into char charPos of container
  108. end repeat
  109. end SubstituteChar
  110.  
  111. on UpdateMenu
  112. -- update the menu on the first card
  113. set lockscreen to true
  114. set lockrecent to true
  115. set lockmessages to true
  116. put 0 into sourceCount
  117. put empty into theList
  118. go cd 1 of bg "examples"
  119. repeat with cdNdx = 1 to the number of cds in this bg
  120. set cursor to busy
  121. go cd cdNdx of this bg
  122. put the short name of this cd into theName
  123. if bg fld "source" Γëá empty then
  124. put " **" after theName
  125. add 1 to sourceCount
  126. end if
  127. put the number of cds of this bg into total
  128. put (the number of this cd - 1) into which
  129. put which & "/" & total into bg fld "card count"
  130. put theName & return after theList
  131. end repeat
  132. go cd 1
  133. put theList into bg fld "list"
  134. put sourceCount
  135. unlock screen
  136. end UpdateMenu
  137.  
  138. on CheckTitles
  139. -- scan throught the card title fields to make sure I haven't left any
  140. --  text in them (text is turned into bitmap to avoid ugly substituted
  141. --  text on systems without the proper font)
  142. lock screen
  143. set lockrecent to true
  144. set lockmessages to true
  145. put empty into theErrors
  146. go cd 1 of bg "examples"
  147. repeat with cdNdx = 1 to the number of cds in this bg
  148. set cursor to busy
  149. go cd cdNdx of this bg
  150. if bg fld "title" Γëá empty or bg fld "expl" Γëá empty then ┬¼
  151. put the short id of this cd & "," after theErrors
  152. end re